3.9.98 \(\int \frac {x^3}{a-b+2 a x^2+a x^4} \, dx\) [898]

Optimal. Leaf size=56 \[ \frac {\tanh ^{-1}\left (\frac {\sqrt {a} \left (1+x^2\right )}{\sqrt {b}}\right )}{2 \sqrt {a} \sqrt {b}}+\frac {\log \left (a-b+2 a x^2+a x^4\right )}{4 a} \]

[Out]

1/4*ln(a*x^4+2*a*x^2+a-b)/a+1/2*arctanh((x^2+1)*a^(1/2)/b^(1/2))/a^(1/2)/b^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.04, antiderivative size = 56, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 22, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.227, Rules used = {1128, 648, 632, 212, 642} \begin {gather*} \frac {\tanh ^{-1}\left (\frac {\sqrt {a} \left (x^2+1\right )}{\sqrt {b}}\right )}{2 \sqrt {a} \sqrt {b}}+\frac {\log \left (a x^4+2 a x^2+a-b\right )}{4 a} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[x^3/(a - b + 2*a*x^2 + a*x^4),x]

[Out]

ArcTanh[(Sqrt[a]*(1 + x^2))/Sqrt[b]]/(2*Sqrt[a]*Sqrt[b]) + Log[a - b + 2*a*x^2 + a*x^4]/(4*a)

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 632

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Dist[-2, Subst[Int[1/Simp[b^2 - 4*a*c - x^2, x], x]
, x, b + 2*c*x], x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 642

Int[((d_) + (e_.)*(x_))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Simp[d*(Log[RemoveContent[a + b*x +
c*x^2, x]]/b), x] /; FreeQ[{a, b, c, d, e}, x] && EqQ[2*c*d - b*e, 0]

Rule 648

Int[((d_.) + (e_.)*(x_))/((a_) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Dist[(2*c*d - b*e)/(2*c), Int[1/(a +
 b*x + c*x^2), x], x] + Dist[e/(2*c), Int[(b + 2*c*x)/(a + b*x + c*x^2), x], x] /; FreeQ[{a, b, c, d, e}, x] &
& NeQ[2*c*d - b*e, 0] && NeQ[b^2 - 4*a*c, 0] &&  !NiceSqrtQ[b^2 - 4*a*c]

Rule 1128

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4)^(p_.), x_Symbol] :> Dist[1/2, Subst[Int[x^((m - 1)/2)*(a +
 b*x + c*x^2)^p, x], x, x^2], x] /; FreeQ[{a, b, c, p}, x] && IntegerQ[(m - 1)/2]

Rubi steps

\begin {align*} \int \frac {x^3}{a-b+2 a x^2+a x^4} \, dx &=\frac {1}{2} \text {Subst}\left (\int \frac {x}{a-b+2 a x+a x^2} \, dx,x,x^2\right )\\ &=-\left (\frac {1}{2} \text {Subst}\left (\int \frac {1}{a-b+2 a x+a x^2} \, dx,x,x^2\right )\right )+\frac {\text {Subst}\left (\int \frac {2 a+2 a x}{a-b+2 a x+a x^2} \, dx,x,x^2\right )}{4 a}\\ &=\frac {\log \left (a-b+2 a x^2+a x^4\right )}{4 a}+\text {Subst}\left (\int \frac {1}{4 a b-x^2} \, dx,x,2 a \left (1+x^2\right )\right )\\ &=\frac {\tanh ^{-1}\left (\frac {\sqrt {a} \left (1+x^2\right )}{\sqrt {b}}\right )}{2 \sqrt {a} \sqrt {b}}+\frac {\log \left (a-b+2 a x^2+a x^4\right )}{4 a}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.01, size = 51, normalized size = 0.91 \begin {gather*} \frac {\frac {2 \sqrt {a} \tanh ^{-1}\left (\frac {\sqrt {a} \left (1+x^2\right )}{\sqrt {b}}\right )}{\sqrt {b}}+\log \left (-b+a \left (1+x^2\right )^2\right )}{4 a} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[x^3/(a - b + 2*a*x^2 + a*x^4),x]

[Out]

((2*Sqrt[a]*ArcTanh[(Sqrt[a]*(1 + x^2))/Sqrt[b]])/Sqrt[b] + Log[-b + a*(1 + x^2)^2])/(4*a)

________________________________________________________________________________________

Maple [A]
time = 0.02, size = 49, normalized size = 0.88

method result size
default \(\frac {\ln \left (a \,x^{4}+2 a \,x^{2}+a -b \right )}{4 a}+\frac {\arctanh \left (\frac {2 a \,x^{2}+2 a}{2 \sqrt {a b}}\right )}{2 \sqrt {a b}}\) \(49\)
risch \(\frac {\ln \left (\left (a \sqrt {a b}-a b \right ) x^{2}+a \sqrt {a b}-\sqrt {a b}\, b \right )}{4 a}+\frac {\ln \left (\left (a \sqrt {a b}-a b \right ) x^{2}+a \sqrt {a b}-\sqrt {a b}\, b \right ) \sqrt {a b}}{4 b a}+\frac {\ln \left (\left (-a \sqrt {a b}-a b \right ) x^{2}-a \sqrt {a b}+\sqrt {a b}\, b \right )}{4 a}-\frac {\ln \left (\left (-a \sqrt {a b}-a b \right ) x^{2}-a \sqrt {a b}+\sqrt {a b}\, b \right ) \sqrt {a b}}{4 b a}\) \(172\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x^3/(a*x^4+2*a*x^2+a-b),x,method=_RETURNVERBOSE)

[Out]

1/4*ln(a*x^4+2*a*x^2+a-b)/a+1/2/(a*b)^(1/2)*arctanh(1/2*(2*a*x^2+2*a)/(a*b)^(1/2))

________________________________________________________________________________________

Maxima [A]
time = 0.51, size = 60, normalized size = 1.07 \begin {gather*} -\frac {\log \left (\frac {a x^{2} + a - \sqrt {a b}}{a x^{2} + a + \sqrt {a b}}\right )}{4 \, \sqrt {a b}} + \frac {\log \left (a x^{4} + 2 \, a x^{2} + a - b\right )}{4 \, a} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^3/(a*x^4+2*a*x^2+a-b),x, algorithm="maxima")

[Out]

-1/4*log((a*x^2 + a - sqrt(a*b))/(a*x^2 + a + sqrt(a*b)))/sqrt(a*b) + 1/4*log(a*x^4 + 2*a*x^2 + a - b)/a

________________________________________________________________________________________

Fricas [A]
time = 0.35, size = 134, normalized size = 2.39 \begin {gather*} \left [\frac {b \log \left (a x^{4} + 2 \, a x^{2} + a - b\right ) + \sqrt {a b} \log \left (\frac {a x^{4} + 2 \, a x^{2} + 2 \, \sqrt {a b} {\left (x^{2} + 1\right )} + a + b}{a x^{4} + 2 \, a x^{2} + a - b}\right )}{4 \, a b}, \frac {b \log \left (a x^{4} + 2 \, a x^{2} + a - b\right ) - 2 \, \sqrt {-a b} \arctan \left (\frac {\sqrt {-a b}}{a x^{2} + a}\right )}{4 \, a b}\right ] \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^3/(a*x^4+2*a*x^2+a-b),x, algorithm="fricas")

[Out]

[1/4*(b*log(a*x^4 + 2*a*x^2 + a - b) + sqrt(a*b)*log((a*x^4 + 2*a*x^2 + 2*sqrt(a*b)*(x^2 + 1) + a + b)/(a*x^4
+ 2*a*x^2 + a - b)))/(a*b), 1/4*(b*log(a*x^4 + 2*a*x^2 + a - b) - 2*sqrt(-a*b)*arctan(sqrt(-a*b)/(a*x^2 + a)))
/(a*b)]

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 110 vs. \(2 (48) = 96\).
time = 0.32, size = 110, normalized size = 1.96 \begin {gather*} \left (\frac {1}{4 a} - \frac {\sqrt {a^{3} b}}{4 a^{2} b}\right ) \log {\left (x^{2} + \frac {4 a b \left (\frac {1}{4 a} - \frac {\sqrt {a^{3} b}}{4 a^{2} b}\right ) + a - b}{a} \right )} + \left (\frac {1}{4 a} + \frac {\sqrt {a^{3} b}}{4 a^{2} b}\right ) \log {\left (x^{2} + \frac {4 a b \left (\frac {1}{4 a} + \frac {\sqrt {a^{3} b}}{4 a^{2} b}\right ) + a - b}{a} \right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x**3/(a*x**4+2*a*x**2+a-b),x)

[Out]

(1/(4*a) - sqrt(a**3*b)/(4*a**2*b))*log(x**2 + (4*a*b*(1/(4*a) - sqrt(a**3*b)/(4*a**2*b)) + a - b)/a) + (1/(4*
a) + sqrt(a**3*b)/(4*a**2*b))*log(x**2 + (4*a*b*(1/(4*a) + sqrt(a**3*b)/(4*a**2*b)) + a - b)/a)

________________________________________________________________________________________

Giac [A]
time = 3.48, size = 46, normalized size = 0.82 \begin {gather*} -\frac {\arctan \left (\frac {a x^{2} + a}{\sqrt {-a b}}\right )}{2 \, \sqrt {-a b}} + \frac {\log \left (a x^{4} + 2 \, a x^{2} + a - b\right )}{4 \, a} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^3/(a*x^4+2*a*x^2+a-b),x, algorithm="giac")

[Out]

-1/2*arctan((a*x^2 + a)/sqrt(-a*b))/sqrt(-a*b) + 1/4*log(a*x^4 + 2*a*x^2 + a - b)/a

________________________________________________________________________________________

Mupad [B]
time = 0.17, size = 153, normalized size = 2.73 \begin {gather*} \frac {\ln \left (x^2\,\sqrt {a^3\,b}+a\,b-a^2-a^2\,x^2\right )}{4\,a}+\frac {\ln \left (x^2\,\sqrt {a^3\,b}-a\,b+a^2+a^2\,x^2\right )}{4\,a}-\frac {\ln \left (x^2\,\sqrt {a^3\,b}-a\,b+a^2+a^2\,x^2\right )\,\sqrt {a^3\,b}}{4\,a^2\,b}+\frac {\ln \left (x^2\,\sqrt {a^3\,b}+a\,b-a^2-a^2\,x^2\right )\,\sqrt {a^3\,b}}{4\,a^2\,b} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x^3/(a - b + 2*a*x^2 + a*x^4),x)

[Out]

log(x^2*(a^3*b)^(1/2) + a*b - a^2 - a^2*x^2)/(4*a) + log(x^2*(a^3*b)^(1/2) - a*b + a^2 + a^2*x^2)/(4*a) - (log
(x^2*(a^3*b)^(1/2) - a*b + a^2 + a^2*x^2)*(a^3*b)^(1/2))/(4*a^2*b) + (log(x^2*(a^3*b)^(1/2) + a*b - a^2 - a^2*
x^2)*(a^3*b)^(1/2))/(4*a^2*b)

________________________________________________________________________________________